<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>出错了</title>
</head>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<body>
<h3>出错了</h3>
<div> <?php echo $msg; ?> </div>
<div><b class="J_timer">3</b>秒后自动返回</div>
</body>
<script>
    var i = 3;
    var intervalId = setInterval(function() {
        i--;
        console.log(i);
        $('.J_timer').text(i);
        if (i <= 0 ) {
            clearInterval(intervalId);
            var ret = window.history.back();
            if (ret === undefined) {
                window.location.href = '/'
            }
        }
    }, 1000);
</script>
</html>